﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Viki_BllFactory;
using Viki_IBll;


namespace Viki1
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void dosubmit_Click(object sender, EventArgs e)
        {
           
        }
        protected void server_serverValidate(object source, ServerValidateEventArgs e)
        {

            IUserService us = Viki_BllFactory.DataAccess.CreateUserService();
            if (username.Text.Equals("") || password.Text.Equals(""))

                e.IsValid = false;
            else if (us.findUser(username.Text, password.Text))
            {
                Session["username"] = username.Text;
                Response.Write("<script language='javascript'>alert('登录成功')</script>");
            }
            else
                e.IsValid = false;
        }
    }
}